﻿// ************** Control ******************
Type.registerNamespace("motobankcorp.UI");
motobankcorp.UI.Control = function(element) {
  motobankcorp.UI.Control.initializeBase(this, [element]);
  this._initProps({ _isLoaded: true });
  this.get_wsErrorDelegate = function() { return Function.createDelegate(this, Dimok$WSError) };
}
motobankcorp.UI.Control.prototype = {
  initialize: function() {
    Dimok$MakeAccessors(this);
    motobankcorp.UI.Control.callBaseMethod(this, 'initialize');
  },
  raiseEvent: Dimok$RaiseEvent,
  _initProps: Dimok$InitializeProperties,
  _initEvents: Dimok$InitializeEvents,
  _hideLoadPanel: Dimok$HideLoadPanel,
  _showLoadPanel: Dimok$ShowLoadPanel,
  findPageEventsGlobal: Dimok$FindPageEvents,
  // Ajax
  _WSError: Dimok$WSError,
  ajax: Dimok$Ajax
}
motobankcorp.UI.Control.registerClass('motobankcorp.UI.Control', Sys.UI.Control);
// ************** Behavior ******************
Type.registerNamespace("motobankcorp.UI");
motobankcorp.UI.Behavior = function(element) {
  motobankcorp.UI.Behavior.initializeBase(this, [element]);
  this.get_wsErrorDelegate = function() { return Function.createDelegate(this, Dimok$WSError) };
}
motobankcorp.UI.Behavior.prototype = {
  initialize: function() {
    Dimok$MakeAccessors(this);
    motobankcorp.UI.Behavior.callBaseMethod(this, 'initialize');
  },
  raiseEvent: Dimok$RaiseEvent,
  _initProps: Dimok$InitializeProperties,
  _initEvents: Dimok$InitializeEvents,
  _hideLoadPanel: Dimok$HideLoadPanel,
  _showLoadPanel: Dimok$ShowLoadPanel,
  findPageEventsGlobal: Dimok$FindPageEvents,
  // Ajax
  get_wsMethodClass: function() {
    if (!this._wsMethodClass) {
      var pe = this.findPageEventsGlobal();
      if (pe && (pe = pe.get_wsClassName())) return pe;
      return alert("wsMethodClass is not defined!");
    }
    return this._wsMethodClass;
  },
  set_wsMethodClass: function(v) { this._wsMethodClass = v; },
  _WSError: Dimok$WSError,
  ajax: Dimok$Ajax
}
motobankcorp.UI.Behavior.registerClass('motobankcorp.UI.Behavior', Sys.UI.Behavior);
// ************** Component ******************
Type.registerNamespace("motobankcorp");
motobankcorp.Component = function() {
  motobankcorp.Component.initializeBase(this);
  this.get_wsErrorDelegate = function() { return Function.createDelegate(this, Dimok$WSError) };
}
motobankcorp.Component.prototype = {
  initialize: function() {
    Dimok$MakeAccessors(this);
    motobankcorp.Component.callBaseMethod(this, 'initialize');
  },
  raiseEvent: Dimok$RaiseEvent,
  _initProps: Dimok$InitializeProperties,
  _initEvents: Dimok$InitializeEvents,
  _hideLoadPanel: Dimok$HideLoadPanel,
  _showLoadPanel: Dimok$ShowLoadPanel,
  findPageEventsGlobal: Dimok$FindPageEvents,
  // Ajax
  _WSError: Dimok$WSError,
  ajax: Dimok$Ajax
}
motobankcorp.Component.registerClass('motobankcorp.Component', Sys.Component);
// ******************************************************************************

Type.registerNamespace("Dimok");

Type.prototype.registerEnumBase = Type.prototype.registerEnum;
Type.prototype.registerEnum = function Dimok$RegisterEnum(enumTypeName, extend) {
  this.registerEnumBase(enumTypeName);
  for (var e in this.prototype) {
    if (extend) this[e] = new Number(this[e]);
    this["get_" + e] = function(name) { return function() { return this[name] } } (e);
    this["get_" + e + "String"] = function(name) { return function() { return this.toString(this[name]) } } (e);
  }
}

Object.forEach = function Object$forEach(object, method, instance, accessorize) {
  /// <summary locid="M:J#Array.forEach" />
  /// <param name="object" type="object" elementMayBeNull="true"></param>
  /// <param name="method" type="Function"></param>
  /// <param name="instance" optional="true" mayBeNull="true"></param>
  var e = Function._validateParams(arguments, [
        { name: "object", type: Object, elementMayBeNull: true },
        { name: "method", type: Function },
        { name: "instance", mayBeNull: true, optional: true },
        { name: "accessorize", type: Boolean, mayBeNull: true, optional: true }
    ]);
  if (e) throw e;
  for (var n in object) {
    if (Object.getType(object[n]) == Function) continue;
    method.call(instance, accessorize ? Dimok$MakeAccessors(object[n]) : object[n], n, object);
  }
}

Sys.EventArgs.prototype.addCancel = function() { if (this._cancel === undefined) { this._cancel = false; this.set_cancel = function(v) { this._cancel = v && true }; this.get_cancel = function() { return this._cancel } } }
Date.prototype.toMSJSON = function() { return '"\\\/Date(' + this.getTime() + ')\\\/"' }
//function Dimok$MSDateToJSDate(data) { return data.replace(/"\\\/(Date\([0-9-]+\))\\\/"/gi, "new $1") }

$J = jQuery.noConflict();
$J.ajaxSetup({
  async: false,
  type: "POST",
  contentType: "application/json; charset=utf-8",
  dataFilter: function(data) { return data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)") },
  dataType: "json",
  error: function(XMLHttpRequest, textStatus, errorThrown) {
    if (XMLHttpRequest.status >= 500)
      return alert(Sys.Serialization.JavaScriptSerializer.deserialize(XMLHttpRequest.responseText).Message);
    $J.popup.show("Server Request", XMLHttpRequest.responseText);
  }
});

$J.fn.extend({
  bubbleTip: function(settings) {
    if (this.length == 0) return alert("No bubble element found") || this;
    var el = $J(settings.element);
    var pos = settings.pos;
    if (!pos) {
      el = $J(":first", el)[0] ? $J(":first", el)[0] : el;
      pos = { top: el.getTopPos() + el.outerHeight(), left: el.getLeftPos() };
    }
    return this.each(function() {
      $J("div:first", this).html(settings.html).parent().css({ left: pos.left, top: pos.top })
					.fadeIn(1000).animate({ opacity: 1.0 }, settings.pause || 5000).fadeOut(2000);
    });
  },
  getLeftPos: function() {
    var element = this[0];
    if (!element || !element.currentStyle) return 0;
    for (var n = 0, e = element; e; e = e.offsetParent)
      n += e.offsetLeft + parseInt(e.currentStyle.paddingLeft) + (parseInt(e.currentStyle.marginLeft) || 0);
    return n + $J(e).getLeftPos();
  },
  getTopPos: function() {
    var element = this[0];
    if (!element || !element.currentStyle) return 0;
    for (var n = 0, e = element; e; e = e.offsetParent)
      n += e.offsetTop + parseInt(e.currentStyle.paddingTop) + (parseInt(e.currentStyle.marginTop) || 0);
    return n + $J(e).getTopPos();
  }
});


function Dimok$Ajax(method, params, success, error, context) {
  context = context || this;
  if (!context.get_wsMethodClass) throw context.constructor.get_name() + " does not contain get_wsMethodClass method.";
  if (!WSA[context.get_wsMethodClass()]) throw context.get_wsMethodClass() + " web service does not exist.";
  var wsPath = WSA[context.get_wsMethodClass()].get_path() + "/" + method;
  if (!WSA[context.get_wsMethodClass()][method]) throw "Method " + method + " does not exist in " + wsPath;
  var parameters = (WSA[context.get_wsMethodClass()][method] + "").match(/function\((.+?)\)/)[1].split(",")
  if (!params.push) params = [params];
  var data = {};
  while (parameters.length > 2 && params.length > 0)
    data[parameters.shift()] = params.shift();
  var jsonString = Sys.Serialization.JavaScriptSerializer.serialize(data);
  if (error) error = Function.createCallback(error, context);
  var ret = null;
  $J.ajax({ url: wsPath, data: jsonString, success: success || _success, error: error });
  return ret;
  function _success(json) {
    ret = success ? Function.createCallback(success, context)(json) : json.d;
  }
}


function Dimok$FindPageEvents() {
  if (!Dimok || !Dimok.PageEvents) return null;
  for (var name in Sys.Application._components)
    if (Dimok.PageEvents.isInstanceOfType(Sys.Application._components[name]))
    return Sys.Application._components[name];
  return null;
}

function Dimok$WSError(result, grid, arg2, arg3) {
  this._hideLoadPanel(this);
  alert(result._message);
}
function Dimok$FindLoadingPanel() {
  if (typeof (Telerik.Web.UI) != "undefined") {
    for (var c = 0, cc = Sys.Application.getComponents(); c < cc.length; c++) {
      if (Telerik.Web.UI.RadAjaxLoadingPanel.isInstanceOfType(cc[c])) return cc[c];
    }
  }
  return null;
}
function Dimok$HideLoadPanel(sender, eventArgs) {
  sender = sender || this;
  $J(sender.get_element()).unblock();
  return;
  var lp = Dimok$FindLoadingPanel();
  if (lp) lp.hide(sender.get_element().id);
}
function Dimok$ShowLoadPanel(sender, message) {
  sender = sender || this;
  $J(sender.get_element()).block({
    message: "Loading ...",
    overlayCSS: { opacity: .05 },
    css: {
      left: "25%",
      border: '2px solid #aaa'
    },
    fadeOut: 200
  });
  return;
  var lp = Dimok$FindLoadingPanel();
  if (!lp) return;
  var divElementStyle = lp.get_element().style;
  divElementStyle.position = 'absolute';
  var el = sender.get_element();
  divElementStyle.left = ((el.offsetLeft + el.offsetWidth / 2) || document.body.scrollWidth / 2) + "px";
  divElementStyle.top = ((el.offsetTop + el.offsetHeight / 2) || document.body.scrollHeight / 2) + "px";
  lp.show(el.id);
}

function Dimok$MakeXmlFromJson(json) {
  var xml = new ActiveXObject("Microsoft.XMLDOM");
  var root = xmlAddElement(xml, "TABLE");
  for (var name in json) {
    var text = json[name] && json[name].constructor && json[name].constructor.getName() == "Date" ?
      json[name].format("MM/dd/yyyy HH:mm tt") : json[name];
    xmlAddJsonElement(root, name, text === null ? '' : text);
  }
  return xml;
  function xmlAddElement(parent, name, attributes) {
    var doc = parent.nodeType == 9 ? parent : parent.ownerDocument;
    var node = parent.appendChild(doc.createElement(name));
    var o;
    for (o in attributes)
      if (attributes[o] !== undefined && attributes[o] !== null)
      node.setAttribute(o, attributes[o]);
    return node;
  }
  function xmlAddJsonElement(parent, name, text) {
    var doc = parent.nodeType == 9 ? parent : parent.ownerDocument;
    var node = parent.appendChild(doc.createElement(name));
    node.appendChild(parent.ownerDocument.createTextNode(text + ''));
    return node;
  }
}
function Dimok$AddProperty(o, name, value, getPrefix, setPrefix) {
  getPrefix = getPrefix || "get";
  setPrefix = setPrefix || "set";
  o[name] = value;
  if (isNaN(parseInt(name)) && typeof o[name] != "function") {
    if (o[getPrefix + name] === undefined)
      o[getPrefix + name] = function(propName) {
        return function() { return o[propName]; }
      } (name);
    if (o[setPrefix + name] === undefined)
      o[setPrefix + name] = function(propName) {
        return function(v) { return o[propName] = v; }
      } (name);
  }
  return value;
}
function Dimok$CopyData(o) {
  if (typeof o == 'undefined') return o;
  var r = {};
  for (var name in o)
    if (typeof o[name] != "function") r[name] = o[name];
  return Dimok$MakeAccessors(r);
}

function Dimok$MakeAccessors(o, getPrefix, setPrefix) {
  if (typeof o == 'undefined') return o;
  for (var name in o) {
    var gp = getPrefix || "get" + _(name);
    var sp = setPrefix || "set" + _(name);
    if (!isNaN(parseInt(name)) || typeof o[name] == "function") continue;
    if (o[gp + name] === undefined)
      o[gp + name] = function(propName) {
        return function() { return o[propName]; }
      } (name);
    if (o[sp + name] === undefined)
      o[sp + name] = function(propName) {
        return function(v) { return o[propName] = v; }
      } (name);
  }
  o.propNames = propNames;
  return o;
  function propNames() {
    var p = [];
    for (name in this)
      if (typeof (this[name]) != "function") p.push(this[name]);
    return p;
  }
  function _(name) { return name.indexOf("_") == 0 ? "" : "_"; }
}
function Dimok$InitializeProperties(props) {
  var type = this.constructor.getName();
  var evalString = '';
  for (var name in props) {
    this[name] = props[name];
    this["get" + name] = function(propName) {
      return function() { return this[propName]; }
    } (name);
    this["get" + name] = function(propName) {
      return function() { return this[propName]; }
    } (name);
    this["set" + name] = function(propName) {
      return function(v) { return this[propName] = v; }
    } (name);
    if (name.endsWith("ID")) {
      var name1 = name.substr(0, name.length - 2);
      this["get" + name1] = function(propName) {
        return function() { return $get(this[propName]); }
      } (name);
      this["find" + name1] = function(propName) {
        return function() { return this[propName] ? $find(this[propName]) : null; }
      } (name);
    }
    //    evalString += "\
    //" + type + ".prototype.get" + name + "=function(){return this." + name + ";};\
    //" + type + ".prototype.set" + name + "=function(v){this." + name + " = v;};\
    //" + (!name.endsWith("ID") ? "" : "\
    //" + type + ".prototype.get" + name.substr(0, name.length - 2) + "=function(){return $get(this.get" + name + "());};\
    //" + type + ".prototype.find" + name.substr(0, name.length - 2) + "=function(){return $find(this.get" + name + "());};\
    //");
    //  }
    //  return evalString;
  }
}
function Dimok$InitializeEvents(_3dd) {
  if (_3dd) {
    var _3de = this;
    for (var i = 0, l = _3dd.length; i < l; i++) {
      var name = _3dd[i];
      this["add_" + name] = function(_3e2) {
        return function(_3e3) {
          this.get_events().addHandler(_3e2, _3e3);
        };
      } (name);
      this["remove_" + name] = function(_3e4) {
        return function(_3e5) {
          this.get_events().removeHandler(_3e4, _3e5);
        };
      } (name);
      this["raise_" + name] = function(_3e6) {
        return function(args) {
          this.raiseEvent(_3e6, args);
        };
      } (name);
    }
  }
}
function Dimok$RaiseEvent(eventName, eventArgs) {
  var handler = this.get_events().getHandler(eventName);
  if (handler) {
    if (!eventArgs) {
      eventArgs = Sys.EventArgs.Empty;
    }
    handler(this, eventArgs);
  }
}
function Dimok$CapitalizeProperty(propertyName, object) {
  var re = new RegExp("^" + propertyName + "$", "i");
  for (var name in object)
    if (name.match(re)) return name;
  return '';
}

function Dimok$ParseMSJSONString(data) {
  try {
    var newdata = data.replace(
            new RegExp('"\\\\\/Date\\\((-?[0-9]+)\\\)\\\\\/"', "g")
                        , "new Date($1)");
    newdata = eval('(' + newdata + ')');
    return newdata;
  }
  catch (e) { return null; }
}

function fillSelectFromJSON(selElement, jsonArray, textName, valName) {
  var sel = $J(selElement);
  sel.attr("length", 0);
  var rs = ($get(selElement.dataSrc.substr(1)) || {}).recordset;
  if (!jsonArray.length) {
    if (sel.attr("IfEmptyValue"))
      sel.html(_makeOption(sel.attr("IfEmptyText"), sel.attr("IfEmptyValue"), sel.attr("IfEmptyStyle")));
    if (rs) rs(selElement.dataFld) = selElement.value;
    return;
  }
  var text = Dimok$CapitalizeProperty(textName || sel.attr("dataTxt") || sel.attr("dataText"), jsonArray[0]);
  var val = _capitalizeProperty(valName || sel.attr("dataVal") || sel.attr("dataValue") || sel.attr("dataFld"), jsonArray[0]);
  var style = _capitalizeProperty("style", jsonArray[0]);
  var selected = _capitalizeProperty("selected", jsonArray[0]);
  text = text || val;
  val = val || text;
  if (!val) val = text = _capitalizeProperty(sel.attr("dataFld"), jsonArray[0]);
  var options = '';
  Array.forEach(jsonArray, _fill, this);
  sel.html(options);
  if (sel.attr("length") > 1) sel.attr("selectedIndex", -1);
  if (sel.attr("length") == 1) selElement.selectedValue = selElement[0].value;
  try {
    if (rs) rs(selElement.dataFld) = selElement.value;
  } finally {
    rs = null;
  }
  function _fill(value) {
    options += _makeOption(value[text], value[val], value[style]);
  }
  function _makeOption(text, value, style, selected) {
    return String.format("<option value='{0}' style='{1}' {3}>{2}</option>", value || text || "", style || "", text || value || "", selected || "");
  }
}
function doEnterKey() {
  if ((event.keyCode == 13 ||
				(!event.srcElement.className.match(/biglist/i) && event.keyCode == 40)) &&
			 event.srcElement.type != "button" &&
			 event.srcElement.tagName != "TEXTAREA"
		) {
    event.cancelBubble = true;
    event.keyCode = 9;
  }
  if (event.keyCode == 38) {
    return;
    var doc = event.srcElement.document;
    var inps = doc.all.tags("INPUT");
    var inpPrev;
    for (var i = 0; i < inps.length; i++) {

    }
  }
}
function json2xml(o, tab) {
  var toXml = function(v, name, ind) {
    var xml = "";
    if (v instanceof Array) {
      for (var i = 0, n = v.length; i < n; i++)
        xml += ind + toXml(v[i], name, ind + "\t") + "\n";
    }
    else if (typeof (v) == "object") {
      var hasChild = false;
      xml += ind + "<" + name;
      for (var m in v) {
        if (m.charAt(0) == "@")
          xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
        else
          hasChild = true;
      }
      xml += hasChild ? ">" : "/>";
      if (hasChild) {
        for (var m in v) {
          if (m == "#text")
            xml += v[m];
          else if (m == "#cdata")
            xml += "<![CDATA[" + v[m] + "]]>";
          else if (m.charAt(0) != "@")
            xml += toXml(v[m], m, ind + "\t");
        }
        xml += (xml.charAt(xml.length - 1) == "\n" ? ind : "") + "</" + name + ">";
      }
    }
    else {
      xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
    }
    return xml;
  }, xml = "";
  for (var m in o)
    xml += toXml(o[m], m, "");
  return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
}

/*	This work is licensed under Creative Commons GNU LGPL License.

License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9
Author:  Stefan Goessner/2006
Web:     http://goessner.net/ 
*/
function xml2json(xml, tab) {
  var X = {
    toObj: function(xml) {
      var o = {};
      if (xml.nodeType == 1) {   // element node ..
        if (xml.attributes.length)   // element with attributes  ..
          for (var i = 0; i < xml.attributes.length; i++)
          o["@" + xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue || "").toString();
        if (xml.firstChild) { // element has child nodes ..
          var textChild = 0, cdataChild = 0, hasElementChild = false;
          for (var n = xml.firstChild; n; n = n.nextSibling) {
            if (n.nodeType == 1) hasElementChild = true;
            else if (n.nodeType == 3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
            else if (n.nodeType == 4) cdataChild++; // cdata section node
          }
          if (hasElementChild) {
            if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
              X.removeWhite(xml);
              for (var n = xml.firstChild; n; n = n.nextSibling) {
                if (n.nodeType == 3)  // text node
                  o["#text"] = X.escape(n.nodeValue);
                else if (n.nodeType == 4)  // cdata node
                  o["#cdata"] = X.escape(n.nodeValue);
                else if (o[n.nodeName]) {  // multiple occurence of element ..
                  if (o[n.nodeName] instanceof Array)
                    o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
                  else
                    o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
                }
                else  // first occurence of element..
                  o[n.nodeName] = X.toObj(n);
              }
            }
            else { // mixed content
              if (!xml.attributes.length)
                o = X.escape(X.innerXml(xml));
              else
                o["#text"] = X.escape(X.innerXml(xml));
            }
          }
          else if (textChild) { // pure text
            if (!xml.attributes.length)
              o = X.escape(X.innerXml(xml));
            else
              o["#text"] = X.escape(X.innerXml(xml));
          }
          else if (cdataChild) { // cdata
            if (cdataChild > 1)
              o = X.escape(X.innerXml(xml));
            else
              for (var n = xml.firstChild; n; n = n.nextSibling)
              o["#cdata"] = X.escape(n.nodeValue);
          }
        }
        if (!xml.attributes.length && !xml.firstChild) o = null;
      }
      else if (xml.nodeType == 9) { // document.node
        o = X.toObj(xml.documentElement);
      }
      else
        alert("unhandled node type: " + xml.nodeType);
      return o;
    },
    toJson: function(o, name, ind) {
      var json = name ? ("\"" + name + "\"") : "";
      if (o instanceof Array) {
        for (var i = 0, n = o.length; i < n; i++)
          o[i] = X.toJson(o[i], "", ind + "\t");
        json += (name ? ":[" : "[") + (o.length > 1 ? ("\n" + ind + "\t" + o.join(",\n" + ind + "\t") + "\n" + ind) : o.join("")) + "]";
      }
      else if (o == null)
        json += (name && ":") + "null";
      else if (typeof (o) == "object") {
        var arr = [];
        for (var m in o)
          arr[arr.length] = X.toJson(o[m], m, ind + "\t");
        json += (name ? ":{" : "{") + (arr.length > 1 ? ("\n" + ind + "\t" + arr.join(",\n" + ind + "\t") + "\n" + ind) : arr.join("")) + "}";
      }
      else if (typeof (o) == "string")
        json += (name && ":") + "\"" + o.toString() + "\"";
      else
        json += (name && ":") + o.toString();
      return json;
    },
    innerXml: function(node) {
      var s = ""
      if ("innerHTML" in node)
        s = node.innerHTML;
      else {
        var asXml = function(n) {
          var s = "";
          if (n.nodeType == 1) {
            s += "<" + n.nodeName;
            for (var i = 0; i < n.attributes.length; i++)
              s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue || "").toString() + "\"";
            if (n.firstChild) {
              s += ">";
              for (var c = n.firstChild; c; c = c.nextSibling)
                s += asXml(c);
              s += "</" + n.nodeName + ">";
            }
            else
              s += "/>";
          }
          else if (n.nodeType == 3)
            s += n.nodeValue;
          else if (n.nodeType == 4)
            s += "<![CDATA[" + n.nodeValue + "]]>";
          return s;
        };
        for (var c = node.firstChild; c; c = c.nextSibling)
          s += asXml(c);
      }
      return s;
    },
    escape: function(txt) {
      return txt.replace(/[\\]/g, "\\\\")
                   .replace(/[\"]/g, '\\"')
                   .replace(/[\n]/g, '\\n')
                   .replace(/[\r]/g, '\\r');
    },
    removeWhite: function(e) {
      e.normalize();
      for (var n = e.firstChild; n; ) {
        if (n.nodeType == 3) {  // text node
          if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
            var nxt = n.nextSibling;
            e.removeChild(n);
            n = nxt;
          }
          else
            n = n.nextSibling;
        }
        else if (n.nodeType == 1) {  // element node
          X.removeWhite(n);
          n = n.nextSibling;
        }
        else                      // any other node
          n = n.nextSibling;
      }
      return e;
    }
  };
  if (xml.nodeType == 9) // document node
    xml = xml.documentElement;
  var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
  return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
}
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
